<?php
defined('_JEXEC') or die('Restricted access');
JToolBarHelper::title(JText::_('COM_JHTRAQ_PROJECT_LIST'), 'generic.png');
JToolBarHelper::addNewX();
JToolBarHelper::editListX();
JToolBarHelper::deleteList();
//JToolBarHelper::preferences('com_jhtraq');
?>

<form action="index.php?option=com_jhtraq&view=projects" method="post" name="adminForm">
<input type="hidden" name="task" value="list" />
<input type="hidden" name="boxchecked" value="0" />
<table>
		<tr>
			<td width="100%">
				<?php echo JText::_( 'COM_JHTRAQ_FILTER' ); ?>:
				<input type="text" name="search" id="search" value="<?php echo $this->search;?>" class="text_area" onchange="document.adminForm.submit();" />
				<button onclick="this.form.submit();"><?php echo JText::_( 'COM_JHTRAQ_GO' ); ?></button>
				
			</td>
		</tr>
	</table>
<table class="adminlist" cellpadding="1">
		<thead>
			<tr>
			<th width="10"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->projects); ?>);" /></th>
				<th width="10">#</th>
				<th><?php echo JText::_('COM_JHTRAQ_PROJECT_NAME');?></th>
				<th><?php echo JText::_('COM_JHTRAQ_PROJECT_SLUG');?></th>
				<th><?php echo JText::_('COM_JHTRAQ_PROJECT_CODENAME');?></th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="5">
					<?php echo $this->pagination->getListFooter(); ?>
				</td>
			</tr>
		</tfoot>
		<tbody>
			<?php
			$r = 0;
			$i = 0;
			foreach($this->projects as $project)
			{
				?>
			<tr class="row<?php echo $r;?>">
				<td><?php echo JHTML::_('grid.id', $i, $project['id'] ); ?></td>
				<td><?php echo $project['id'];?></td>
				<td><a href="index.php?option=com_jhtraq&view=projects&task=edit&cid[]=<?php echo $project['id'];?>"><?php echo $project['name'];?></a></td>
				<td><?php echo $project['slug'];?></td>
				<td><?php echo $project['codename'];?></td>
			</tr>
			<?php
			$r = 1-$r;
			$i++;
			}
			?>
		</tbody>
</table>
</form>